package com.ruoyi.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 账户操作明细对象 t_account_record
 * 
 * @author mzr
 * @date 2023-12-13
 */
@Data
public class TAccountRecord extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 账户操作明细主键 */
    private Long id;

    /** 账户主键 */
    @Excel(name = "账户主键")
    private Long accountId;

    /** 操作前金额 */
    @Excel(name = "操作前金额")
    private BigDecimal amountBefore;

    /** 操作金额 */
    @Excel(name = "操作金额")
    private BigDecimal amount;

    /** 操作后金额 */
    @Excel(name = "操作后金额")
    private BigDecimal amountAfter;

    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date creatTime;

    /** 操作类型 （1-加款  0-扣款） */
    @Excel(name = "操作类型 ", readConverterExp = "1=-加款,0=-扣款")
    private Integer type;

    /** 操作人 */
    @Excel(name = "操作人")
    private String operator;

    @Excel(name = "申请单主键")
    private Long fromId;

    // 联查 账户名称
    private String accountName;

    /*补充字段*/

    @Excel(name = "申请人")
    private String userName;

    @Excel(name = "申请单类型")
    private String fromName;

    @Excel(name = "通过备注")
    private String auditRemark;

    @Excel(name = "申请单详情")
    private String fromInfo;

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("accountId", getAccountId())
            .append("amountBefore", getAmountBefore())
            .append("amount", getAmount())
            .append("amountAfter", getAmountAfter())
            .append("creatTime", getCreatTime())
            .append("type", getType())
            .append("operator", getOperator())
            .append("fromId", getFromId())
            .toString();
    }
}
